|
![](/i/fill.gif) |
. wrote:
> "Orchid XP v8" <voi### [at] dev null> wrote
> > Unfortunately, it has become common for programs to give messages such
> > as "an unexpected error has occurred. Sorry."
> >
> > [BTW, WTF is an *expected* error anyway??]
> Actually, the above *is* an example of an expected error (the programmer put
> that message in, didn't he?). Unexpected errors either go unnoticed or crash
> the system.
Wrong. Unexpected errors are things which should never happen, and if
they do the indicate a bug in the program.
Typical example:
switch(something)
{
case A: ...
case B: ...
...
default:
error("Unexpected error happened.");
// This should never happen because all possible cases were dealt above.
// If we ever get here, it's a clear sign of a bug in the program.
}
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |